package com.starleague.battletech.unit.mech.command;

import com.starleague.battletech.command.AbstractBattletechCommand;
import com.starleague.battletech.controller.IBattletechContext;
import com.starleague.battletech.unit.mech.IMutableMech;
import com.starleague.battletech.unit.mech.dto.IMechDto;

public abstract class AbstractMechCommand
        extends AbstractBattletechCommand
{
    private final IMechDto mechDto;

    public AbstractMechCommand(IMechDto mechDto)
    {
        this.mechDto = mechDto;
    }

    protected <CONTEXT extends IBattletechContext> IMutableMech getMech(CONTEXT context)
    {
        return context.resolveMech(this.mechDto);
    }
}
